package bg.btanev.eightyfour.shared.command.profileevent;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import bg.btanev.eightyfour.shared.command.CommandInput;
import bg.btanev.eightyfour.shared.dto.TagDto;
import bg.btanev.eightyfour.shared.dto.TargetDto;
import bg.btanev.eightyfour.shared.state.ProfileType;

/**
 *
 * @author B.Tanev
 *
 */
public class FindProfileEventsInput implements CommandInput {
	/**
	 *
	 */
	private static final long serialVersionUID = -5655512631597582794L;

	private TargetDto target;
	private Date beginDate;
	private Date endDate;
	private ArrayList<TagDto> tags;
	private String query;
	private ProfileType profileType;

	public TargetDto getTarget() {
		return target;
	}

	public void setTarget(TargetDto target) {
		this.target = target;
	}

	public void setProfileType(ProfileType profileType) {
		this.profileType = profileType;
	}

	public ProfileType getProfileType() {
		return profileType;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public List<TagDto> getTags() {
		return tags;
	}

	public void setTags(ArrayList<TagDto> tags) {
		this.tags = tags;
	}

	public String getQuery() {
		return query;
	}

	public void setQuery(String query) {
		this.query = query;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((beginDate == null) ? 0 : beginDate.hashCode());
		result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
		result = prime * result + ((query == null) ? 0 : query.hashCode());
		result = prime * result + ((target == null) ? 0 : target.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FindProfileEventsInput other = (FindProfileEventsInput) obj;
		if (beginDate == null) {
			if (other.beginDate != null)
				return false;
		} else if (!beginDate.equals(other.beginDate))
			return false;
		if (endDate == null) {
			if (other.endDate != null)
				return false;
		} else if (!endDate.equals(other.endDate))
			return false;
		if (query == null) {
			if (other.query != null)
				return false;
		} else if (!query.equals(other.query))
			return false;
		if (target == null) {
			if (other.target != null)
				return false;
		} else if (!target.equals(other.target))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "FindProfileEventsInput [beginDate=" + beginDate + ", endDate=" + endDate + ", query=" + query
				+ ", tags=" + tags + ", target=" + target + "]";
	}
}
